#include <stdio.h>

int main(void){
    int sum, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;

    printf("Enter the first (single) digit: ");
    scanf("%1d", &i0);
    printf("\nEnter the first group of five digits: ");
    scanf("%1d%1d%1d%1d%1d", &i1,&i2,&i3,&i4,&i5);
    printf("\nEnter the second group of five digits: ");
    scanf("%1d%1d%1d%1d%1d", &i6,&i7,&i8,&i9,&i10);
    sum = 9-(((i0+i2+i4+i6+i8+i10)*3+(i1+i3+i5+i7+i9)-1)%10);
    printf("\ni0 : %d", i0);
    printf("\nfirst group : %d%d%d%d%d", i1,i2,i3,i4,i5);
    printf("\nsecond group : %d%d%d%d%d", i6,i7,i8,i9,i10);
    printf("\nCheck code: %d", sum);

    return 0;

}
